import request from '@/utils/request'

// 查询角色列表
export function createApi(postData) {
  return request({
    url: '/role',
    method: 'post',
    data: postData,
  })
}
export function deleteByIdApi(id) {
  return request({})
}

export function modifyByIdApi(id, data) {
  return request({
    url: `/role/${id}`,
    method: 'put',
    data: data,
  })
}

export function modifyStatusByIdApi(id) {
  return request({
    url: `/role/status/${id}`,
    method: 'put',
  })
}

export function getListApi() {
  return request({
    url: '/role/list',
    method: 'get',
  })
}

export function getPageApi(queryOption) {
  return request({
    url: '/role',
    method: 'get',
    params: queryOption,
  })
}

export function  getResourcesByRoleIdApi(roleId) {
  return request({
    url: `/roleResources/${roleId}`,
    method: 'get',
  })
}